﻿using Alipay.AopSdk.Core.Domain;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using SmartWMS.Common.Extensions;
using SmartWMS.Common.ResponseOutput;
using SmartWMS.Domain.BasicsDatum;
using SmartWMS.Domain.BusinessManage;
using SmartWMS.Domain.FinanceManage;
using SmartWMS.Server.BusinessServer.SalesReturns;
using SmartWMS.Server.BusinessServer.SalesReturns.Dto;
using Yitter.IdGenerator;

namespace SmartWMS.API.Controllers.BusinessMange
{
    /// <summary>
    /// 采购退货
    /// </summary>
    [Route("api/[controller]/[action]")]
    [ApiController]
    public class SalesReturnsgoodsController : ControllerBase
    {
        private readonly ISalesReturns _salesReturns;

        public SalesReturnsgoodsController(ISalesReturns salesReturns)
        {
            _salesReturns = salesReturns;
        }


        /// <summary>
        /// 添加应收管理
        /// </summary>
        /// <param name="input"></param>
        /// <returns></returns>
        [HttpPost]
        public Task<Response<bool>> AddCollection(PaymentDto input)
        {
            return _salesReturns.AddCollection(input);
        }

        /// <summary>
        /// 修改审核状态
        /// </summary>
        /// <param name="input"></param>
        /// <returns></returns>
        [HttpPost]
        public Task<Response<bool>> UpProcuremenReturnState(ProcuremenReturnInfo input)
        {
            return _salesReturns.UpProcuremenReturnState(input);
        }

        /// <summary>
        /// 产品信息
        /// </summary>
        /// <param name="info"></param>
        /// <returns></returns>
        [HttpPost]
        public Task<ProcuremenReturnInfo> GetProductProcList(ProcuremenReturnInfo info)
        {
            return _salesReturns.GetProductProcList(info);
        }

        /// <summary>
        /// 产品信息列表
        /// </summary>
        /// <param name="info"></param>
        /// <returns></returns>
        [HttpPost]
        public Task<List<ProcuremenReturnInfo>> GetProductProcLists(ProcuremenReturnInfo info)
        {
            return _salesReturns.GetProductProcLists(info);
        }

        /// <summary>
        /// 采购退货信息分页查询
        /// </summary>
        /// <param name="info"></param>
        /// <returns></returns>
        [HttpPost]
        public Task<Response<List<ProcuremenReturnInfo>>> GetPageProductProcList(ProcuremenReturnInfo info)
        {
            return _salesReturns.GetPageProductProcList(info);
        }

        /// <summary>
        /// 批量删除采购退货信息
        /// </summary>
        /// <param name="input"></param>
        /// <returns></returns>
        [HttpPost]
        public Task<Response<bool>> PlDelProcuremenReturn(List<ProcuremenReturn> input)
        {
            return _salesReturns.PlDelProcuremenReturn(input);
        }

        /// <summary>
        /// 采购退货删除
        /// </summary>
        /// <param name="info"></param>
        /// <returns></returns>
        [HttpPost]
        public Task<Response<bool>> DelProcuremenReturn(ProcuremenReturnInfo info)
        {
            return _salesReturns.DelProcuremenReturn(info);
        }

    }
}
